package cn.itsource.feignclients;

import cn.itsource.domain.User;
import cn.itsource.fallback.MyFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "user-server",fallback = MyFeignClientFallback.class)//写远程调用的服务名
public interface MyFeignClient {

    //url,参数，返回值类型必须一样
    @GetMapping("/user/{id}")
    public User getUserById(@PathVariable("id") Long id);
}
